﻿using System;

namespace Lottery.App.Model
{
    public class RecordInfo
    {
        public RecordInfo() { }

        public RecordInfo(string issue, string result)
        {
            //int[] array = Utility.Utils.ConvertStringToIntArray(result);
            //foreach (int item in array)
            //{
            //    Result += String.Format("{0:D2} ", item);
            //}
            //Result = Result.Trim();

            IssueNum = issue;
            Result = result;
            ASC_Result = Utility.Utils.Sort(Result);
            A1 = Result.Substring(0, 2);
            A3 = Result.Substring(0, 8);
            P3 = Utility.Utils.Sort(A3);
        }

        public virtual int ID { get; private set; }

        public virtual string IssueNum { get; set; }

        public virtual string Result { get; set; }

        public virtual string ASC_Result { get; set; }

        public virtual string A1 { get; set; }

        public virtual string A3 { get; set; }

        public virtual string P3 { get; set; }

        public virtual string Date
        {
            get {
                return IssueNum.Substring(0, 8);
            }
        }

        public virtual int Num 
        {
            get {
                return Convert.ToInt32(IssueNum.Substring(8));
            }
        }

    }
}
